<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Textarea Demo</title>
<style type="text/css">
	@IMPORT url("css/common.css");
	@IMPORT url("css/view.css");
</style>
<script type="text/javascript">
	var _gmlUrl = '<s:url value="/process/positionGML.do" includeParams="none"/>?pathRow=22,22';
	var _x = -100;
	var _y = 40;
	
function initMap() {
    var _resolutions = [
//        1.40625, 
//        0.703125, 
//        0.3515625, 
        0.17578125, 
        0.087890625, 
        0.0439453125,
        0.02197265625, 
        0.010986328125, 
        0.0054931640625
//        0.00274658203125,
//        0.001373291015625, 
//        0.0006866455078125, 
//        0.00034332275390625,
//        0.000171661376953125, 
//        0.0000858306884765625, 
//        0.00004291534423828125,
//        0.00002145767211914062, 
//        0.00001072883605957031,
//        0.00000536441802978515, 
//        0.00000268220901489257
    ];
        var box_extents = [
            [-10, 50, 5, 60],
            [-75, 41, -71, 44],
            [-122.6, 37.6, -122.3, 37.9],
            [10, 10, 20, 20]
        ];
    
	var options = {
				resolutions: _resolutions,
                minExtent: new OpenLayers.Bounds(-10, -10, 10, 10), 
                maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90), 
                controls: [new OpenLayers.Control.MouseDefaults()]
	          };

	var map = new OpenLayers.Map('map', options);

	map.addControl(new OpenLayers.Control.PanZoomBar());
	var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", 
	        "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});
	
    var vlayer = new OpenLayers.Layer.Boxes("Boxes");
    var boxes  = vlayer;

    for (var i = 0; i < box_extents.length; i++) {
        ext = box_extents[i];
        bounds = new OpenLayers.Bounds(ext[0], ext[1], ext[2], ext[3]); 
        box = new OpenLayers.Marker.Box(bounds);
        box.events.register("click", box, function (e) {
            this.setBorder("yellow");
        });
        boxes.addMarker(box);
    }

	map.addControl(new OpenLayers.Control.LayerSwitcher({'ascending':false}));
	
	map.addLayer(layer);
	map.addLayer(vlayer);

	map.setCenter(new OpenLayers.LonLat(-100, 40), 1);
}
</script>
<script type="text/javascript" src="http://www.openlayers.org/api/OpenLayers.js" ></script>
</head>
<body onload="initMap();">
	<div id="map" style="font-weight: bold;vertical-align: top;"></div>
</html>